package cn.tedu.spring.iocxml;

import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ruoLi
 */

public class UserTest {
    //1 测试bean对象的创建及根据id属性值获取bean对象
    @Test
    public void test() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        User user = (User) context.getBean("user");
        user.run();
    }
    @Test
    public void test2() {
        List<String> list=new ArrayList<>();
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        User user = (User) context.getBean("user2");
        user.run();
    }
}
